﻿using UnityEngine;
using UnityEngine.UI;

public class SceneShot : MonoBehaviour
{
    private void Start()
    {
        RawImage rawImage = GetComponentInChildren<RawImage>();
        Button btn = GetComponentInChildren<Button>();
        btn.onClick.AddListener(() =>
        {
            WinFormShot(rawImage);
        });
    }

    private void WinFormShot(RawImage rawImage)
    {
        Cutter.StartShot((texture2D) =>
        {
            rawImage.texture = texture2D;
            rawImage.SetNativeSize();
        });
    }
    
}
